import React, { Component } from 'react';
import style from './HomeSearch.module.scss';

import { withRouter } from 'react-router-dom';

class HomeSearch extends Component {

    jumpToSearchCenter = () => {
        this.props.history.push('/searchCenter');
    }

    render() {
        return (
            <div className={style.homeSearch}>
                <div className={style.homeSearchContent} onClick={this.jumpToSearchCenter}>搜索</div>
            </div>
        )
    }
}

export default withRouter(HomeSearch);
/*
高阶组件中的withRouter, 作用是将一个组件包裹进Route里面,
然后react-router的三个对象history, location, match就会被放进这个组件的props属性中.
*/
